package com.liuxu.topnews.acitivity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.liuxu.topnews.R;
import com.liuxu.topnews.Adapter.RecycleAdapter;
import com.liuxu.topnews.bean.App;

import java.util.ArrayList;

public class RecycleActivity extends AppCompatActivity {
    ArrayList<App> apps=new ArrayList<>();
    RecyclerView recyclerView;
    RecycleAdapter adapter;
    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycle);
        recyclerView= (RecyclerView)findViewById(R.id.recycler_view);
        adapter=new RecycleAdapter(this,apps);
        adapter.setHasStableIds(true);
        LinearLayoutManager layoutManager=new LinearLayoutManager(this);
        layoutManager.setOrientation((LinearLayoutManager.VERTICAL));
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setAdapter(adapter);
    }
}
